package com.hundsun.fmbp.deploy.utils;

/**
 * @Description: 类型转换
 * @author fangqh07068
 * @date 2015-7-2 上午11:26:46
 */
public class Transform {

    // 获取Long类型值
    public static Long getLongValue(Object value) {
        if (value instanceof Long) {
            return (Long) value;
        } else if (value instanceof Number) {
            return ((Number) value).longValue();
        } else {
            return Long.valueOf(value.toString());
        }
    }

    // 获取int类型值
    public static Integer getIntegerValue(Object value) {
        if (value instanceof Integer) {
            return (Integer) value;
        } else if (value instanceof Number) {
            return ((Number) value).intValue();
        } else {
            return Integer.valueOf(value.toString());
        }
    }

}
